/*
	File:		Player.h
	Author:		Ben Feldmann
	Purpose:	Class for managing game player
*/

#pragma once


#include "Entity.h"
#include "Animation.h"
#include "AnimationSystem.h"

class MeleeWeapon;
class RangedWeapon;


class Player : public Entity 
{
private:
	float health;
	int curWeapon;
	int skillOne;
	int skillTwo;
	float moveSpeed;
	MeleeWeapon* weapon1;
	RangedWeapon* weapon2;
	int scrapMetal;
	int circuitry;

	float prevX;
	float prevY;
	bool collided;
	Animation player;
	int playerID;

public:
	Player();
	~Player();

	void UseSkill(int skill);
	void Attack();
	void SpecialAttack();

	virtual void Update(float elapsed);
	virtual void Render();
	virtual bool CheckCollision(IEntity* base);

	int GetCurWeapon() {return curWeapon;}

	void SetAnimationID(int id)
	{
		playerID = id;
		player = *AnimationSystem::GetInstance()->GetAnimation(playerID);
	}

	RECT GetRect()
	{
		RECT tmp = player.GetCollsionRect();
		tmp.top = tmp.top + GetY();
		tmp.bottom = tmp.bottom + GetY();
		tmp.left = tmp.left + GetX();
		tmp.right = tmp.right + GetX();
		return tmp;
	}

	// 1: Melee Weapon - 2: Ranged Weapon
	int GetCurWeapon() const	{return curWeapon;}
};
